//
// C++ Interface: view
//
// Description: 
//
//
// Author: Os3 s.r.l. <xgui@os3.it>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef _XGUI_VIEW_H_
#define _XGUI_VIEW_H_

#include "xguifwd.h"
#include "widget.h"

namespace xguimpl { struct View; }

namespace xgui 
{  
    %feature("docstring","derives from :class:`xgui.WidgetClass` ") ViewClass;
	struct ViewClass : public xgui::WidgetClass
	{
		ViewClass();
		std::string const &className();
	};

	class Model;

    %feature("docstring","derives from :class:`xgui.Widget` \n\n**PROPERTIES**\n\nnone.\n\n**EVENTS**\n\nnone.\n\n**METHODS**\n\n") View;
	class View : public xgui::Widget
	{
		private:
			View(xgui::Container * parent, xgui::ClassInfo * cinfo, xguimpl::View * widget);
			virtual ~View();

		public:
		    %feature("docstring","sets a new model for the view. The model holds all the data that the view will display.\n\n*C++*::\n\n void setModel ( xgui::Model * model );\n\n") setModel;
			void setModel ( xgui::Model * model );
			%feature("docstring","returns the model assigned to the view.\n\n*C++*::\n\n xgui::Model * getModel();\n\n") getModel;
			xgui::Model * getModel();

            %feature("docstring","updates the view contents retrieving the data from the assigned model.\n\n*C++*::\n\n void refresh();\n\n") refresh;
			void refresh();

            %feature("docstring","returns true if the model item identified by <parent> and <child_pos> is currently selected in this view\n\n*C++*::\n\n bool isSelected(xgui::Model * parent, int child_pos);\n\n") isSelected;
			bool isSelected(xgui::Model * parent, int child_pos);
			%feature("docstring","changes the selected state of the model item identified by <parent> and <child_pos> in this view.\nIf <state> is true the state is changed to *\"selected\"* ; otherwise it's changed to *\"unselected\"* \n\n*C++*::\n\n void select(xgui::Model * parent, int child_pos, bool state);\n\n") select;
			void select(xgui::Model * parent, int child_pos, bool state);
			%feature("docstring","changes the selected state of all the children of the model item identified by <parent> in this view.If <state> is true the state is changed to *\"selected\"* ; otherwise it's changed to *\"unselected\"* .\n\n*C++*::\n\n void selectAll(xgui::Model * parent, bool state);\n\n") selectAll;
			void selectAll(xgui::Model * parent, bool state);
	};

}

#endif
